package com.tinygone.productserver.service.impl;

import com.tinygone.productserver.dao.ProductInfoRepository;
import com.tinygone.productserver.entity.ProductInfo;
import com.tinygone.productserver.entity.ProductStatusEnum;
import com.tinygone.productserver.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liqigang
 */
@Service("productService")
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductInfoRepository productInfoRepository;

    @Override
    public List<ProductInfo> findUpAll() {
        return productInfoRepository.findByProductStatus(ProductStatusEnum.UP.getCode());
    }
    @Override
    public List<ProductInfo> findList(List<String> productList) {
        return productInfoRepository.findByProductIdIn(productList);
    }
}
